__author__ = 'y.starynets'

name = raw_input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"

handle = open(name)

counts = dict()
for word in handle:
  if word.startswith('From '):
     words = word.split()
     mail = words[1]
     counts[mail] = counts.get(mail,0) + 1

bigcount = None
bigword = None
for word,count in counts.items():
    if bigcount is None or count > bigcount:
        bigword = word
        bigcount = count

print bigword, bigcount